Skip to content

Instantly share code, notes, and snippets.

@ozgurshn
ozgurshn / RectangleObservationProjection.swift
Created May 28, 2020 13:41
Vision normalized rectangle detection projection in Swift
func observationToRect(box:VNRectangleObservation)->CGRect
{
let xCord = box.topLeft.x * imageView.frame.size.width
let yCord = (1 - box.topLeft.y) * imageView.frame.size.height
let width = (box.topRight.x - box.bottomLeft.x) * imageView.frame.size.width
let height = (box.topLeft.y - box.bottomLeft.y) * imageView.frame.size.height
return CGRect(x: xCord, y: yCord, width: width, height: height)
}
@PeterTheOne
PeterTheOne / plz-coord-austria.csv
Created August 17, 2016 16:09
PLZ coordinates austria, August 2016, Geocoded with OSM
9163 Unterbergen K 01.01.1966 PLZ-Adressierung extern Ja Nein 46.4781017 14.2559153 225
9135 Bad Eisenkappel K 01.01.1966 PLZ-Adressierung extern Ja Ja 46.4812105646964 14.6062427452371 225
9170 Ferlach K 01.01.1966 PLZ-Adressierung extern Ja Ja 46.5253656509035 14.3104077671798 225
9182 Maria Elend K 01.01.1966 PLZ-Adressierung extern Ja Nein 46.5298704238434 14.0761492080012 225
9181 Feistritz im Rosental K 01.01.1966 PLZ-Adressierung extern Ja Ja 46.5322359733192 14.1353740987715 225
9183 Rosenbach K 01.01.1966 PLZ-Adressierung extern Ja Nein 46.5364895720495 14.0376219311205 225
9162 Strau K 01.01.1966 PLZ-Adressierung extern Ja Ja 46.538069 14.263217 225
9173 St. Margareten im Rosental K 01.01.1966 PLZ-Adressierung extern Ja Nein 46.5424186613725 14.4066575369548 225
9602 Thörl-Maglern K 01.01.1966 PLZ-Adressierung extern Ja Ja 46.5432506251966 13.6473041244356 225
9072 Ludmannsdorf K 01.01.1966 PLZ-Adressierung extern Ja Nein 46.5434291311274 14.1433352631987 225
@fjpalacios
fjpalacios / arch-i3gaps-install.md
Last active May 17, 2024 10:13
Arch + i3-gaps Install Guide

Arch + i3-gaps Install Guide

First set up your keyboard layout. For example, in Spanish:

   # loadkeys es

For a list of all acceptable keymaps:

   # localectl list-keymaps
@markasoftware
markasoftware / enterprise_token.rb
Last active May 17, 2024 10:10
OpenProject Enterprise mode for free
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ it doesn't show that enterprise mode is enabled in the settings, but all ################
############ enterprise mode features, such as KanBan boards, are enabled. ################
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
@SheldonWangRJT
SheldonWangRJT / WWDC18-416.md
Last active May 17, 2024 10:09
WWDC18 Notes by Sheldon - Session 416 - iOS Memory Deep Dive

WWDC18 Notes - Session 416 - iOS Memory Deep Dive

All session list link: Here
Session Link: Here
Demo starts @ 25:30 in the video.
Download session slides: Here

This notes is written by Sheldon after watching WWDC18 session 416. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

@nicoplv
nicoplv / ProgressBarHelper
Created January 18, 2023 13:21
An helper to be able to use the Unity Progress Bar with background or async operations
[UnityEditor.InitializeOnLoad]
public class ProgressBarHelper
{
#region Methods
protected static List<Action> actions = new List<Action>();
static ProgressBarHelper()
{
UnityEditor.EditorApplication.update += Update;
@amanjuman
amanjuman / sh.md
Last active May 17, 2024 10:08
Debian 12 Netplan.io

Install Packages

sudo apt install netplan.io openvswitch-switch

Configure Netplan

nano /etc/netplan/network.yaml
network:
@indygreg
indygreg / find_old_lines.pl
Created June 17, 2012 20:17
Find oldest lines in git repository
#!/usr/bin/perl
# This script parses Git blame's "porcelain" output format and
# ascertains the oldest lines of code seen.
#
# If you want to perform a custom report, just define your own callback
# function and invoke parse_porcelain() with it.
#
# The expected input format is slightly modified from raw `git blame
# -p`. Here is an example script for producing input:
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except: